﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddCar.aspx.cs" Inherits="Webcar.Car.AddCar" %>

<%@ Register Assembly="WebPager" Namespace="Zw.Control" TagPrefix="cc1" %>

<%@ Register Src="../Controls/NaviBar.ascx" TagName="NaviBar" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>车辆档案编辑</title>
</head>
<script language = "javaScript" src ="../JavaScript/default.js" type="text/javascript"></script>
<body >
    
    <form id="form1" runat="server">
    <div id="AddCar" >
        <div class="content" >
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <uc1:NaviBar ID="NaviBar1" runat="server" />
            <br />
            <div class="tips">
                <span>提示:带*号的项目必须录入</span>
                </div>
            <br />
            <table id = "t" width="100%" cellspacing="1" cellpadding="1" bgcolor="#006699" border="0">
                <tr class="tableAlterItems">
                    <td class="tdleft" >
                        *牌照号：</td>
                    <td class="tdright">
                        <asp:TextBox ID="tbRecordNo" Width="97%" runat="server"></asp:TextBox></td>
                   <td class="tdleft" >
                        内部牌照号：</td>
                    <td class="tdright">
                        <asp:TextBox ID="tbRecordNo2"  Width="97%" runat="server"></asp:TextBox></td>
                </tr>
                <tr class="tableAlterItems">
                    <td class="tdleft" >
                        *所属单位：</td>
                    <td class="tdright">
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddlDept" Width="100%" runat="server" OnSelectedIndexChanged="ddlDept_SelectedIndexChanged" AutoPostBack="True">
                                </asp:DropDownList>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                    <td class="tdleft" >
                        下级单位：</td>
                    <td class="tdright">
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddlChildDept" Width="100%" runat="server">
                                </asp:DropDownList>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="ddlDept" EventName="SelectedIndexChanged" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr class="tableAlterItems">
                    <td class="tdleft" >
                        *行驶证单位：</td>
                    <td class="tdright">
                        <asp:TextBox ID="tbRunDept" runat="server" Width="97%"></asp:TextBox></td>
                    <td class="tdleft" >
                        是否特种车辆：</td>
                    <td class="tdright">
                        <asp:CheckBox id="chkTz" runat="server"/>
                    </td>
                    
                </tr>
                <tr class="tableAlterItems">
                    <td class="tdleft" >
                        *车辆用途：</td>
                    <td class="tdright" >
                        <asp:DropDownList ID="ddlCarUse" Width="100%" runat="server">
                        </asp:DropDownList></td>
                    <td class="tdleft"  >
                        *车型：</td>
                    <td class="tdright" >
                        <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                        <asp:DropDownList ID="ddlCarSort" runat="server" Width="100%" AutoPostBack="True" OnSelectedIndexChanged="ddlCarSort_SelectedIndexChanged">
                        </asp:DropDownList>
                        
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="ddlCarSort" EventName="SelectedIndexChanged" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr class="tableAlterItems">
                    <td class="tdleft" >
                        *详细车型：</td>
                    <td class="tdright" colspan="3"  >
                        <asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                        <asp:DropDownList ID="ddlCarClass" Width="41%" runat="server">
                        </asp:DropDownList>
                        &nbsp;&nbsp;&nbsp;在此处添加新车型： 
                        <asp:TextBox ID="tbCarClassName"  Width="28%" runat="server"></asp:TextBox>
                                <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">保存</asp:LinkButton>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="ddlCarSort" EventName="SelectedIndexChanged" />
                            </Triggers>
                        </asp:UpdatePanel>
                     </td>
                     
                </tr>
                <tr class="tableAlterItems">
                    <td class="tdleft"   >
                        客位数：</td>
                    <td >
                        <asp:TextBox ID="tbGuestNum" runat="server" Width="97%"></asp:TextBox></td>
                    <td class="tdleft"  >
                        *资产归属：</td>
                    <td >
                        <asp:DropDownList ID="ddlAssetDept" Width="100%" runat="server">
                        </asp:DropDownList></td>
                </tr>
                <tr class="tableAlterItems">
                    <td class="tdleft"   >
                        *引擎号：</td>
                    <td >
                        <asp:TextBox ID="tbEngineNo" Width="97%" runat="server"></asp:TextBox></td>
                    <td class="tdleft"   >
                        *车架号：</td>
                    <td >
                        <asp:TextBox ID="tbShelfNo" Width="97%" runat="server"></asp:TextBox></td>
                </tr>
                    <tr class="tableAlterItems">
                    <td class="tdleft"   >
                        *购置日期：</td>
                    <td >
                        <cc1:Calendar ID="dtBuyDate" runat="server" IsWrite="False" Width="97%"></cc1:Calendar></td>
                    <td class="tdleft"   >
                        购置号：</td>
                    <td >
                        <asp:TextBox ID="tbBuyNo" Width="97%" runat="server"></asp:TextBox></td>
                </tr>
                <tr class="tableAlterItems">
                    <td class="tdleft"   >
                        *价格：</td>
                    <td >
                        <asp:TextBox ID="tbPrice" Width="97%" runat="server"></asp:TextBox></td>
                    <td class="tdleft"   >
                        *载重：</td>
                    <td >
                        <asp:TextBox ID="tbWeight" Width="97%" runat="server"></asp:TextBox></td>
                </tr>
                <tr class="tableAlterItems">
                    <td class="tdleft"   >
                        *颜色：</td>
                    <td style="height: 18px" >
                        <asp:TextBox ID="tbColor" Width="97%" runat="server"></asp:TextBox></td>
                    <td class="tdleft"   >
                        *百公里耗油量：</td>
                    <td style="height: 18px" >
                        <asp:TextBox ID="tbFuel" Width="97%" runat="server"></asp:TextBox></td>
                </tr>
               <tr class="tableAlterItems">
                    <td class="tdleft"   >
                        驾驶员：</td>
                    <td style="height: 18px" >
                        <asp:TextBox ID="tbDriverName" Width="80%" runat="server"></asp:TextBox>
                        <a href="#" onclick="javascript:openSelectWindow()">选择</a>&nbsp;&nbsp;
                        </td>
                        <div style="display:none">
                            <asp:TextBox ID="tbDriverID" runat="server"></asp:TextBox>
                        </div>
                    <td class="tdleft"   >
                    排气量：
                        </td>
                    <td style="height: 18px" >
                        <asp:TextBox ID="tbDisplacement" Width="97%" runat="server"></asp:TextBox>
                        </td>
                </tr>
               <%--<tr class="tableAlterItems">
                    <td class="tdleft"   >
                        第二车型：</td>
                    <td style="height: 18px" >
                    <asp:DropDownList ID="ddlCarClass2" Width="100%" runat="server">
                        </asp:DropDownList>
                        </td>
                    <td class="tdleft"   >
                        </td>
                    <td style="height: 18px" >
                        </td>
                </tr>--%>
            </table>
            <br />
            <div class="footer">
                <div class="e">
                    <asp:Label ID="lblInfo" runat="server" ForeColor="Blue" Text=""></asp:Label>
                    <hr class="line_blue" />
                    <asp:UpdatePanel ID="UpdatePanel6" runat="server">
                        <ContentTemplate>
                            <asp:Label ID="lblError" ForeColor="red" runat="server"></asp:Label>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
                <asp:Label ID="Label1" ForeColor="red" runat="server"></asp:Label>
                <asp:Button ID="btnSave" runat="server" Text="保存数据" SkinID="default_button" Width="60px" OnClick="btnSave_Click" UseSubmitBehavior="false" />
                <input id="Button2" type="button" value="返回" style="width:60px" class="button" onclick="javascript:history.back(1);" />
                </div>
        </div>
    </div>
        
        
    
    </form>
</body>
</html>
<script type="text/javascript" language="javascript">
function openSelectWindow()
{
    var ret = openDialog("../Driver/SelectDriver.aspx?query=",470, 360);
    if(ret!=undefined)
    {
        var pos = ret.indexOf(",");
        var man_code = ret.substring(0,pos);
        var man_name = ret.substring(pos+1);
        
        document.getElementById("tbDriverID").value = man_code.toString();
        document.getElementById("tbDriverName").value = man_name.toString();
    }
}
</script>